package cn.com.scooper.pojo.dto.ks;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 *{
 * 	"version": "v2",
 * 	"dataId": "12783376468351209473",
 * 	"gatewayId": "330182A00101",
 * 	"enterpriseId": "330182A001",
 * 	"collectTime": "20230724152000",
 * 	"isConnectDataSource": true,
 * 	"reportType": "report",
 * 	"datas": [
 *                {
 * 			"quotaId": "330182A001020001",
 * 			"values": [
 *                {
 * 					"childParam": "HZD77010401",
 * 					"value": 2.42
 *                },
 *                {
 * 					"childParam": "HZD77010402",
 * 					"value": -2.18
 *                },
 *                {
 * 					"childParam": "HZD77010403",
 * 					"value": 2.33
 *                }
 * 			],
 * 			"singleType": "",
 * 			"isValid": true
 *        }
 * 	]
 * }
 */
@Data
public class ReportActualDataDto extends ReportDataDto {

    @Valid
    @NotNull
    private List<DataPo> datas;//指标数据集合

    @Data
    public static class DataPo{
        @NotNull
        private String quotaId;//设备编码，由系统下发
        @Valid
        @NotNull
        private List<DataValuePo> values;//指标当前采集值
        @NotNull
        private String singleType;//启停信号，必填：on表示开启状态;off标识停止状态
        @NotNull
        private Boolean isValid;//标识本项采集值是否有效：true表示有效；false表示无效
    }

    @Data
    public static class DataValuePo{
        @NotNull
        private String childParam;//子参数类型，没有子参数类型就放设备类型。设备类型HZD77
        @NotNull
        private Float value;//采集值
    }
}


